home *** CD-ROM | disk | FTP | other *** search
-
- if __name__ != '__main__':
- import js
- import ff
-
- import level
- import os
- import sys
- import whichdb
- import string
-
-
- if __name__ == '__main__':
- fname = sys.argv[1]
- else:
- fname = ff.fileName
- print "running from inside the engine..."
-
- print "Hello, level filename = %s of type %s" % (fname, whichdb.whichdb(fname))
-
- l = level.LevelFile(fname, 0)
-
- if __name__ != '__main__':
- strName = l['name']['name']
- strStartup = l['onStartup']['scriptText']
- js.missionDefBegin(strName, strStartup)
- else:
- print "Parsing level (%s)" % l['name']
-
- for k in l.keys():
- if string.find(k, 'obj_') != -1:
-
- dict = {}
- dict = eval(`l[k]`)
-
- if __name__ == '__main__':
- print "GameObject: %s: %s, %s @ (%f, %f, %f) : %d, %d, %d, %d" % (k, dict['nifTAG'], dict['GAME_CLASS'],
- dict['pos_x'], dict['pos_y'], dict['pos_z'],
- dict['quat_1'],
- dict['quat_2'],
- dict['quat_3'],
- dict['quat_4'])
-
- else:
- js.missionAddObject(k,
- dict['nifTAG'],
- dict['GAME_CLASS'],
- dict['pos_x'],
- dict['pos_y'],
- dict['pos_z'],
- dict['quat_1'],
- dict['quat_2'],
- dict['quat_3'],
- dict['quat_4'])
-
-
- if __name__ != '__main__':
- js.missionDefEnd()
-
-
-